package controller;

import java.util.List;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import model.User;
import service.UserService;

@Controller
@RequestMapping("userController")
public class UserController {
	private static Logger log = Logger.getLogger(UserController.class);

	@Autowired
	UserService userService;
	
	@RequestMapping("test")
	@ResponseBody
	public List<User> test(){
		System.out.println("=======");
		List<User> userList = userService.findAllUser();
		User user = userService.findUserById(16);
		System.out.println("结果:"+user);
		
		log.error("this is a log4j test...");
		return null;
	}

}
